<%= render :partial => 'admin/shared/cms_left_bar', :locals => { :on => 1 } -%>

<div id="main">
  <%= render :partial => 'admin/shared/menu_bar', :locals => { :new_entry_link => new_admin_recommend_subject_path } -%>
  <%= render :partial => 'form' -%>
  
  <div class="box mb10">
    <table class="table border" id="product_list">
      <caption><%= @recommend_subject.title %> 主题</caption>
      <thead>
        <tr>
        <th width="38">#</th>
        <th width="38">排序</th>
        <th width="38">编号</th>
        <th>名称</th>
        </tr>
      </thead>
      <tbody>
        <% @recommend_subject.item_recommends.each do |recommend| -%>
          <tr class="<%= cycle('', 'tr2') %>">
          <td><a href="#" class="delete" rel="<%= recommend.id %>">X</a></td>
          <td><%= recommend.position %></td>
          <td><%= recommend.relation_id %></td>
          <td><%= recommend.name %></td>
          </tr>
        <% end -%>
      </tbody>
    </table>
  </div>
<!--  
  <div class="box mb10">
    <% form_for :recommend_subject, :url => create_recommends_admin_recommend_subject_path, :html => { :method => :post } do |f| -%>
    <table class="table border">
      <thead>
        <tr>
          <td height="35" colspan="4">
          <%= hidden_field_tag :id, @recommend_subject.id -%>
          <a class="btt bttb" id="add_commends">添加到该主题</a>
          <%= link_to '热门商品', edit_admin_recommend_subject_path(@recommend_subject), :class => 'btt bttb' %>
          <%= link_to '本周人气', edit_admin_recommend_subject_path(@recommend_subject, :flag => 2), :class => 'btt bttb' %>
          <%= link_to '推荐商品', edit_admin_recommend_subject_path(@recommend_subject, :flag => 3), :class => 'btt bttb' %>
          </td>
        </tr>
        <tr>
          <th width="15"><input type="checkbox" id="check_all"></th>
          <th width="38">商编号</th>
          <th>商品名称</th>
          <th>品牌</th>
        </tr>
      </thead>
      <tbody>
        <% @commends.each do |commends| -%>
          <tr class="<%= cycle('', 'tr2') %>">
            <td><input type="checkbox" class="check" name="recommend_ids[]" value="<%= commends.id %>"></td>
            <td><%= commends.id %></td>
            <td><%= commends.name %></td>
            <td><%= commends.brand %></td>
          </tr>
        <% end -%>
      </tbody>
    </table>
    <% end %>
  </div>-->
</div>

<%= javascript_include_tag 'admin/base' -%>
